package com.example.homework.repositories

import UserResponse
import com.example.homework.repositories.CONSTANTS.BASE_URL
import retrofit2.Response
import retrofit2.Retrofit
import retrofit2.converter.moshi.MoshiConverterFactory
import retrofit2.http.GET


object RetrofitService {
    private val retrofit: Retrofit =
        Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(MoshiConverterFactory.create())
            .build()

    val getDataApi: GetDataApi = retrofit.create(GetDataApi::class.java)
}

interface GetDataApi {
    @GET("api/")
    suspend fun getData(): UserResponse
}